﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Newtonsoft.Json;
using System.Collections.Generic;

public partial class 湖南长沙_CrewRep : System.Web.UI.Page
{
    BLL.BLLValRep br = new BLL.BLLValRep();
    IList<Hashtable> list = null;
    object obj = null;
    protected void Page_Load(object sender, EventArgs e)
    {
        string param = Request["param"];
        if (param != "")
        {
            if (param == "query")
            {
                int id = Convert.ToInt32(Request["id"]);
                string time = Request["time"];
                QueryTableList(id, time);
            }
        }
        else
        {
            QueryTableList(1, DateTime.Now.Year.ToString());
        }
    }
    protected void QueryTableList(int id, string time)
    {
        string sTime = time + "-01-01";
        string eTime = time + "-12-31";
        list = br.getJz();
        string strApp = br.getJzSj(id, sTime, eTime);
        int index = strApp.IndexOf(',');
        int length = Convert.ToInt32(strApp.Substring(0, index));
        strApp = strApp.Remove(0, index + 1);
        obj = new
        {
            num = length,
            tableInfo = strApp,
            list = list
        };
        string result = JavaScriptConvert.SerializeObject(obj);
        Response.Write(result);
        Response.End();
    }
}